package com.huawei.service.impl;

import com.huawei.dao.*;
import com.huawei.entity.Picture;
import com.huawei.entity.Shangpinsku;
import com.huawei.entity.Sytuijian;

import com.huawei.service.SytuijianService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName U
 * @Description TODO
 * @Author 闫修奇
 * @Date 2021/11/27 17:14
 */

 @Service
public class SytuijianServiceImpl implements SytuijianService {


     @Resource
     SytuijianMapper sytuijianMapper;
     @Resource
     SkuMapper skuMapper;


    @Override
    public List<Sytuijian> select(Map<String, Object> pars) {

        List<Sytuijian> list=sytuijianMapper.select(pars);

        for(Sytuijian n:list){
            n.setSkuList(skuMapper.getId(n.getSku_id()));
        }

        return list ;
    }

    @Override
    public int count(Map<String, Object> pars) {
        return sytuijianMapper.count(pars);
    }

    @Override
    public int add(Sytuijian sytuijian) {
        return sytuijianMapper.add(sytuijian);
    }

    @Override
    public int update1(int id, String status) {
        return sytuijianMapper.update1(id,status);
    }

    @Override
    public int update(Sytuijian sytuijian) {
        return sytuijianMapper.update(sytuijian);
    }

    @Override
    public int delete(int id) {
        return sytuijianMapper.delete(id);
    }
}
